package com.ruoyi.web.controller.admin;

import com.ruoyi.common.annotation.Anonymous;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.entity.SysDept;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.module.domain.Order;
import com.ruoyi.module.service.IOrderService;
import com.ruoyi.module.vo.UserReportFormVo;
import com.ruoyi.system.service.ISysDeptService;
import com.ruoyi.system.service.ISysUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.*;
import java.util.stream.Collectors;

//报表模块
@RestController
@RequestMapping("/admin/ach")
@Anonymous
public class AchievementController extends BaseController {
    @Autowired
    private ISysUserService userService;
    /**
     * 员工业绩
     */
    @GetMapping("/listUser")
    public TableDataInfo listUser(SysUser sysUser) {
        startPage();
        return getDataTable(userService.selectUserAdminByUserList(sysUser));
    }

    /**
     * 团队业绩
     */
    @GetMapping("/teamUser")
    public TableDataInfo teamUser(SysUser sysUser) {
        startPage();
        return getDataTable(userService.selectUserAdminByTeamList(sysUser));
    }
    /**
     * 单位业绩
     */
    @GetMapping("/companyUser")
    public TableDataInfo companyUser(SysUser sysUser) {
        startPage();
        return getDataTable(userService.selectUserAdminByCompanyList(sysUser));
    }

    /**
     * 量化报表
     */
    @GetMapping("/quantitativeReport")
    public TableDataInfo quantitativeReport(SysUser sysUser) {
        startPage();
        return getDataTable(userService.quantitativeReport(sysUser));
    }

}
